<template>
  <div class="Showcase1">
    <div class="Showcase1-top">
      <div
        class="title-box"
        v-for="(item, index) in props.list"
        :key="index"
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(Number(index)), item.width, 1.533)}rem`,
          backgroundImage: `url(${publicUrls + 'free/style14/exhibitsStyle2Bg.webp'})`,
        }"
      >
        <p>{{ item.name }}</p>
      </div>
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style14/cabinetStyle2BgTopLeft.webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style14/cabinetStyle2BgTopCenter.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style14/cabinetStyle2BgTopRight.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <img
        class="Showcase1-center-left"
        :src="publicUrls + 'free/style14/cabinetStyle2BgCenterLeft.webp'"
        alt=""
      />
      <div
        class="Showcase1-center-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style14/cabinetStyle2BgCenterCenter.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-center-right"
        :src="publicUrls + 'free/style14/cabinetStyle2BgCenterRight.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-btm">
      <img
        class="Showcase1-btm-left"
        :src="publicUrls + 'free/style14/cabinetStyle2BgBottomLeft.webp'"
        alt=""
      />
      <div
        class="Showcase1-btm-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style14/cabinetStyle2BgBottomCenter.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-btm-right"
        :src="publicUrls + 'free/style14/cabinetStyle2BgBottomRight.webp'"
        alt=""
      />
    </div>
    <!-- <div class="inverted">
        <img :src="publicUrls + 'free/style8/ShowcaseInverted1.webp'" alt="" class="left" />
        <div class="content"></div>
        <img :src="publicUrls + 'free/style8/ShowcaseInverted3.webp'" alt="" class="right" />
      </div> -->
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free14Style2',
});
</script>
<script lang="ts" setup>
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
// 1.30
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.1;
};
</script>

<style lang="less" scoped>
.Showcase1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 225px;
  min-width: 330px;
}
.Showcase1-top {
  display: flex;
  width: 100%;
  height: 86px;
}
.title-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 94px;
  left: 0;
  z-index: 10;
  width: 232px;
  height: 40px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  p {
    width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #20b3ba;
    text-align: center;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25);
    -webkit-text-stroke-width: 0.3px;
    -webkit-text-stroke-color: #d4bb8f;
    font-family: 'SourceHanSerifCN';
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 180%; /* 32.4px */
  }
}
.Showcase1-top-left {
  width: 86px;
  height: 100%;
}
.Showcase1-top-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-top-right {
  width: 86px;
  height: 100%;
}
.Showcase1-center {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 33px;
  // transform: translateY(-2px);
}
.Showcase1-center-left {
  width: 86px;
  height: 100%;
}
.Showcase1-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-center-right {
  width: 86px;
  height: 100%;
}
.Showcase1-btm {
  display: flex;
  width: 100%;
  height: 106px;
}
.Showcase1-btm-left {
  width: 86px;
  height: 100%;
}
.Showcase1-btm-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-btm-right {
  width: 86px;
  height: 100%;
}
</style>
